using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using TTXNA.src.Util;
using TTXNA.src.Engine.Graphics;

namespace TTXNA.src.Engine.World
{
    public abstract class GameObject
    {
        protected ObjectInfo objectInfo;
        private Vector3 objectLocation;
        private Vector3 objectRotation;

        public GameObject(Vector3 location)
        {
            this.objectLocation = location;

            TTXNAGame.graphicsWorld.AddObject(this);
        }

        public string Name
        {
            get { return objectInfo.Name; }
            set { objectInfo.Name = value; }
        }

        public Vector3 Location
        {
            get { return objectLocation; }
            set { objectLocation = value; }
        }

        public Vector3 Rotation
        {
            get { return objectRotation; }
            set { objectRotation = value; }
        }

        public ObjectInfo Info
        {
            get { return objectInfo; }
        }

        public Coordinate ObjectCoordinate
        {
            get { return new Coordinate((int)Math.Round(objectLocation.X), (int)Math.Round(objectLocation.Z)); }
        }

        public DDDCoordinate ObjectDDDCoordinate
        {
            get { return new DDDCoordinate((int)Math.Round(objectLocation.X), 
                                            (int)Math.Round(objectLocation.Y * TTXNAGame.HeightScale), 
                                            (int)Math.Round(objectLocation.Z)); }
        }

    }
}
